package leetcode.hot100;

import base.TreeNode;
import offer.BuildTree;

import java.util.ArrayList;
import java.util.List;

/**
 * 前序、中序、后序遍历
 */
public class TreePre {

    public static void main(String[] args) {

    }

    public void  recursion(TreeNode root ,List<Integer> res ) {
        if (root!=null) {
            res.add(root.val);
        }
        if (root.left!=null) {
            recursion(root.left, res);
        }
        if (root.right!=null) {
            recursion(root.right, res);
        }
    }
}
